package com.syni.mdd.yhd.common.all.controller.protect;

/**
 * @className BmsBusinessController
 * @description TOO
 * @Author cfx
 * @DATE 2019/4/15 14:25
 * @VERSION 1.0
 **/

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckParams;
import com.syni.mdd.yhd.common.all.service.BmsMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/music")
public class BmsMusicController {
    @Autowired
    BmsMusicService bmsMusicService;

    @PostMapping("/getBackMusic")
    @CheckParams(checkAuth = true,params = {"page_num","page_size"})
    public Map<String,Object> getBackMusic(@RequestBody Map<String,Object> paramsMap){
        Integer userId = Integer.parseInt(paramsMap.get("userIdentify").toString());
        Integer pageNum = Integer.parseInt(paramsMap.get("page_num").toString());
        Integer pageSize = Integer.parseInt(paramsMap.get("page_size").toString());
        return bmsMusicService.findBackMusic(userId,pageNum,pageSize);
    }
}
